package com.qinhao.loveCrowdFunding.service;

import com.qinhao.loveCrowdFunding.mapper.UserLoginMapper;
import com.qinhao.loveCrowdFunding.pojo.IntegralChangeEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class IntegralService {
    @Autowired
    UserLoginMapper userLoginMapper;

    public void addIntegralChange(Integer count, Integer userId, String message) {
        IntegralChangeEntity integralChangeEntity = IntegralChangeEntity.builder().count(count).userId(userId).message(message).build();
        userLoginMapper.addIntegralRecord(integralChangeEntity);
        userLoginMapper.changeIntegral(integralChangeEntity);
    }
}
